#include "graphics/image.h"

EsdlImage * esdlLoadImage(const char * path) {
	struct EsdlImage * image = malloc(sizeof * image);
	
	image->surface = NULL;
	image->surface = IMG_Load(path);
	
	if(image->surface == NULL) {
		free(image);
		return NULL;
	}
	
	return image;
}

void esdlDeleteImage(EsdlImage * image) {
	SDL_FreeSurface(image->surface);
	free(image);
}

